package com.ruoyi.basebill.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.basebill.domain.Ttttest;
import com.ruoyi.basebill.service.ITtttestService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 测试测试Controller
 * 
 * @author xiefeng
 * @date 2023-02-06
 */
@RestController
@RequestMapping("/settlementCenter/basebill/ttttest")
public class TtttestController extends BaseController
{
    @Autowired
    private ITtttestService ttttestService;

    /**
     * 查询测试测试列表
     */
    @PreAuthorize("@ss.hasPermi('settlementCenter/basebill:ttttest:list')")
    @GetMapping("/list")
    public TableDataInfo list(Ttttest ttttest)
    {
        startPage();
        List<Ttttest> list = ttttestService.selectTtttestList(ttttest);
        return getDataTable(list);
    }

    /**
     * 导出测试测试列表
     */
    @PreAuthorize("@ss.hasPermi('settlementCenter/basebill:ttttest:export')")
    @Log(title = "测试测试", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Ttttest ttttest)
    {
        List<Ttttest> list = ttttestService.selectTtttestList(ttttest);
        ExcelUtil<Ttttest> util = new ExcelUtil<Ttttest>(Ttttest.class);
        util.exportExcel(response, list, "测试测试数据");
    }

    /**
     * 获取测试测试详细信息
     */
    @PreAuthorize("@ss.hasPermi('settlementCenter/basebill:ttttest:query')")
    @GetMapping(value = "/{fid}")
    public AjaxResult getInfo(@PathVariable("fid") Long fid)
    {
        return success(ttttestService.selectTtttestByFid(fid));
    }

    /**
     * 新增测试测试
     */
    @PreAuthorize("@ss.hasPermi('settlementCenter/basebill:ttttest:add')")
    @Log(title = "测试测试", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody Ttttest ttttest)
    {
        return toAjax(ttttestService.insertTtttest(ttttest));
    }

    /**
     * 修改测试测试
     */
    @PreAuthorize("@ss.hasPermi('settlementCenter/basebill:ttttest:edit')")
    @Log(title = "测试测试", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Ttttest ttttest)
    {
        return toAjax(ttttestService.updateTtttest(ttttest));
    }

    /**
     * 删除测试测试
     */
    @PreAuthorize("@ss.hasPermi('settlementCenter/basebill:ttttest:remove')")
    @Log(title = "测试测试", businessType = BusinessType.DELETE)
	@DeleteMapping("/{fids}")
    public AjaxResult remove(@PathVariable Long[] fids)
    {
        return toAjax(ttttestService.deleteTtttestByFids(fids));
    }
}
